package com.ruoyi.personnel.salary.calculation.service;

import com.ruoyi.personnel.salary.calculation.domain.CalculationCond;
import com.ruoyi.personnel.salary.calculation.domain.CalculationDomain;
import com.ruoyi.personnel.salary.calculation.mapper.CalculationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工资计算业务执行层
 * @author lsy 2021.7.20
 */
@Service
public class CalculationServiceImpl implements ICalculationService{

    @Autowired
    private CalculationMapper calculationMapper;

    /**
     * 获取所有工资计算记录
     * @param cond 搜索条件
     * @return
     */
    @Override
    public List<CalculationDomain> selectCalculationList(CalculationCond cond) {
        return calculationMapper.selectCalculationList(cond);
    }

    /**
     * 获取指定工资计算记录
     * @param calculationItemId 计算项目编号
     * @return
     */
    @Override
    public CalculationDomain selectCalculationById(String calculationItemId) {
        return calculationMapper.selectCalculationById(calculationItemId);
    }

    /**
     * 新增工资计算记录
     * @param calculation 员工事件记录
     * @return
     */
    @Override
    public int insertCalculation(CalculationDomain calculation) {
        return calculationMapper.insertCalculation(calculation);
    }

    /**
     * 修改工资计算记录
     * @param calculation 员工事件记录
     * @return
     */
    @Override
    public int updateCalculation(CalculationDomain calculation) {
        return calculationMapper.updateCalculation(calculation);
    }

    /**
     * 删除工资计算记录
     * 仅修改删除标志
     * @param calculation
     * @return
     */
    @Override
    public int updateCalculationDeleteFlag(CalculationDomain calculation) {
        return calculationMapper.updateCalculationDeleteFlag(calculation);
    }

    /**
     * 获取所有数据字段
     * @return
     */
    @Override
    public List<String> getALLDataField() {
        return calculationMapper.getALLDataField();
    }

}
